package se.schtohan.repository;

import org.springframework.stereotype.Repository;
import se.schtohan.model.Book;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@Repository
public class BookRepositoryImpl implements BookRepository {

    @PersistenceContext
    private EntityManager em;

    @Override
    public void save(Book book) {

        em.persist(book);
        em.flush();

    }
}
